﻿using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;

namespace TestCluster.usermodels
{
    /// <summary>
    /// 
    /// </summary>
    public class RoleInfoAddDto
    {

        ///<summary>
        ///权限模块
        ///</summary>
        [RegularExpression("[a-z,0-9]{1,16}", ErrorMessage = "模块名称必须为英文小写或者数字")]
        [Required(ErrorMessage = "模块名称必填")]
        public string Model { get; set; }

        ///<summary>
        ///权限项
        ///</summary>
        [RegularExpression("[a-z,0-9]{1,16}", ErrorMessage = "权限名称必须为英文小写或者数字")]
        [Required(ErrorMessage = "权限名称必填")]
        public string Name { get; set; }

        ///<summary>
        ///描述
        ///</summary>
        [MaxLength(64, ErrorMessage = "权限描述最大不超过64位")]
        public string Desc { get; set; }

        ///<summary>
        ///状态
        ///</summary>
        public bool IsEnable { get; set; } = true;

        ///<summary>
        ///排序
        ///</summary>
        public int Sort { get; set; } = 100;

        /// <summary>
        /// 父级的概念
        /// </summary>
        public int FatherId { get; set; } = 0;

    }
    /// <summary>
    /// 
    /// </summary>
    public class RoleInfoDto : EntityDto<int>
    {

        ///<summary>
        ///权限模块
        ///</summary>
        [MaxLength(16)]
        public string Model { get; set; }

        ///<summary>
        ///权限项
        ///</summary>
        [MaxLength(16)]
        public string Name { get; set; }

        ///<summary>
        ///描述
        ///</summary>
        [MaxLength(64)]
        public string Desc { get; set; }

        ///<summary>
        ///状态
        ///</summary>

        public bool IsEnable { get; set; }

        ///<summary>
        ///排序
        ///</summary>

        public int Sort { get; set; }

        /// <summary>
        /// 父级的概念
        /// </summary>
        public int FatherId { get; set; }

        /// <summary>
        /// 层级
        /// </summary>
        public int Level { get; set; }
    }
    /// <summary>
    /// 
    /// </summary>
    public class RoleInfoListDto : EntityDto<int>
    {

        ///<summary>
        ///权限模块
        ///</summary>
        [MaxLength(16)]
        public string Model { get; set; }

        ///<summary>
        ///权限项
        ///</summary>
        [MaxLength(16)]
        public string Name { get; set; }

        ///<summary>
        ///描述
        ///</summary>
        [MaxLength(64)]
        public string Desc { get; set; }

        ///<summary>
        ///状态
        ///</summary>
        public bool IsEnable { get; set; }

        ///<summary>
        ///排序
        ///</summary>
        public int Sort { get; set; }

        /// <summary>
        /// 父级的概念
        /// </summary>
        public int FatherId { get; set; }

        /// <summary>
        /// 层级
        /// </summary>
        public int Level { get; set; }
    }
    /// <summary>
    /// 
    /// </summary>
    public class RoleInfoUpdateDto : EntityDto<int>
    {

        ///<summary>
        ///权限模块
        ///</summary>
        [MaxLength(16)]
        [Required(ErrorMessage = "权限的模块必须不为空，请输入")]
        public string Model { get; set; }

        ///<summary>
        ///权限项
        ///</summary>
        [MaxLength(16)]
        [Required(ErrorMessage = "权限的值必须不为空，请输入")]
        public string Name { get; set; }

        ///<summary>
        ///描述
        ///</summary>
        [MaxLength(64)]
        public string Desc { get; set; }

        ///<summary>
        ///状态
        ///</summary>
        public bool IsEnable { get; set; } = true;

        ///<summary>
        ///排序
        ///</summary>
        public int Sort { get; set; } = 100;

        /// <summary>
        /// 父级的概念
        /// </summary>
        public int FatherId { get; set; } = 0;

    }
}
